﻿using System;

namespace CloudTaobao
{
    public class TradeRecord
    {
        public string tid { get; set; }
        public string num_iid{get;set;}
        public string seller_nick { get; set; }
        public string title { get; set; }
        private string statusInternal { get; set; }
        public string status
        {
            get
            {
                if (statusInternal.Equals("WAIT_BUYER_PAY"))
                    return "等待买家付款";
                else if (statusInternal.Equals("WAIT_SELLER_SEND_GOODS"))
                    return "等待卖家发货";
                else if (statusInternal.Equals("WAIT_BUYER_CONFIRM_GOODS"))
                    return "等待买家确认";
                else if (statusInternal.Equals("TRADE_BUYER_SIGNED"))
                    return "买家已签收";
                else if (statusInternal.Equals("TRADE_FINISHED"))
                    return "交易成功";
                else if (statusInternal.Equals("TRADE_CLOSED"))
                    return "退款成功，已关闭";
                else if (statusInternal.Equals("TRADE_CLOSED_BY_TAOBAO"))
                    return "付款前关闭";
                else
                    return "无交易";
            }
            set
            {
                statusInternal = value;
            }
        }
        public string color
        {
            get 
            {
                if (statusInternal.Equals("WAIT_BUYER_PAY"))
                    return "Orange";
                else if (statusInternal.Equals("WAIT_SELLER_SEND_GOODS"))
                    return "OrangeRed";
                else if (statusInternal.Equals("WAIT_BUYER_CONFIRM_GOODS"))
                    return "DarkBlue";
                else if (statusInternal.Equals("TRADE_BUYER_SIGNED"))
                    return "Blue";
                else if (statusInternal.Equals("TRADE_FINISHED"))
                    return "Green";
                else if (statusInternal.Equals("TRADE_CLOSED"))
                    return "Red";
                else if (statusInternal.Equals("TRADE_CLOSED_BY_TAOBAO"))
                    return "Black";
                else
                    return "White";
            }
        }

        public TradeRecord()
        {
            num_iid = "";
            title = "";
            seller_nick = "";
            statusInternal = "TRADE_NO_CREATE_PAY";
        }
    }
}
